//赋值
function setEditAdminForm(){
	$("#editAdminForm").find("input[name='areaId']").combobox({
		panelHeight:145,
		data:getAllAreaJson(),
		required:true,
		editable:false
	});
	var form = $("#editAdminForm");
    var param = $('#editAdminWindow').panel('options').param;
	var row = param.row;
    if(row){
    	$(form).form("load",row);
    	$(form).find("input[name='name']").attr("disabled","disabled");
    }else{
    	$(form).form("load",[]);
    	$(form).find("input[name='name']").removeAttr("disabled");
    }
}

function subEditAdmin(){
	var form = $("#editAdminForm");
	var name = $(form).find("input[name='name']").val();
	var pwd = $(form).find("input[name='pwd']").val();
	if(!name || name=="") {
		alert("请输入管理账号!");
		return false;
	}
	if(!pwd || pwd=="") {
		alert("请输入管理密码!");
		return false;
	}
	$(form).find("input[name='name']").removeAttr("disabled");
	$.post("EditAdminInfo", form.serialize(), function(text) {
			var data = (new Function("return "+text))();
			alert(data.status);
			if(data.status=='保存成功'){
				var param = $('#editAdminWindow').panel('options').param;
				param.callback();
			    $("#editAdminWindow").window('close');
			}
	});
}
setEditAdminForm();